<?php
/**
 * ZookeeperClient
 *
 * @package zookeeper-admin
 */

namespace timandes;

class ZookeeperClient extends \Zookeeper {
    static public $_instence;
	private function __clone(){}
	static public function getInstence() {
		if (empty(self::$_instence) || !(self::$_instence instanceof self)) {
			self::$_instence = new self();
		}
		return self::$_instence;
	}
    public function get($path, $watcher_cb = NULL, &$stat_info = NULL) {
        $value = parent::get($path);
        if (!is_string($value))
            return $value;
        
        $retval = @unserialize($value);
        if ($retval === false)
            return $value;
        else
            return $retval;
    }
}
